
#include "gameBegin.h"
#include "HelloWorldScene.h"

USING_NS_CC;

gameBegin::gameBegin(void)
{
}


gameBegin::~gameBegin(void)
{
}

Scene* gameBegin::createScene()
{
	Scene* scene=Scene::create();
	gameBegin* gos=gameBegin::create();
	scene->addChild(gos);

	return scene;
}

bool gameBegin::init()
{
	if (!LayerColor::initWithColor(Color4B(255,255,255,255)))
	{
		return false;
	}

	Size size=Director::getInstance()->getVisibleSize();


	Label* label_simple=Label::createWithSystemFont("SIMPLE","fonts/Marker Felt.ttf",30);
	label_simple->setColor(Color3B::GREEN);
		 
	Label* label_medium=Label::createWithSystemFont("MEDIUM","fonts/Marker Felt.ttf",30);
	label_medium->setColor(Color3B::RED);
		 
	Label* label_difficult=Label::createWithSystemFont("DIFFCULT","fonts/Marker Felt.ttf",30);
	label_difficult->setColor(Color3B::BLACK);
		 
	auto menu1=MenuItemLabel::create(label_simple,CC_CALLBACK_1(gameBegin::replaceScene_simple,this));
	auto menu2=MenuItemLabel::create(label_medium,CC_CALLBACK_1(gameBegin::replaceScene_medium,this));
	auto menu3=MenuItemLabel::create(label_difficult,CC_CALLBACK_1(gameBegin::replaceScene_difficult,this));
		 
	auto menu=Menu::create(menu1,menu2,menu3,NULL);
	menu->alignItemsVerticallyWithPadding(100);

	this->addChild(menu);

	return true;
}

void gameBegin::replaceScene_simple(cocos2d::Ref* ref)
{
	HelloWorld::m_flag=1;
	auto scene=TransitionZoomFlipX::create(1,HelloWorld::createScene());
	Director::getInstance()->replaceScene(scene);
}

void gameBegin::replaceScene_medium(cocos2d::Ref* ref)
{
	HelloWorld::m_flag=2;
	auto scene=TransitionZoomFlipX::create(1,HelloWorld::createScene());
	Director::getInstance()->replaceScene(scene);
}

void gameBegin::replaceScene_difficult(cocos2d::Ref* ref)
{
	HelloWorld::m_flag=3;
	auto scene=TransitionZoomFlipX::create(0.5,HelloWorld::createScene());
	Director::getInstance()->replaceScene(scene);
}



